home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 08 (1988)(MegaDisc Digital Publishing)(AU)[WB].zip / MegaDisc 08 (1988)(MegaDisc Digital Publishing)(AU)[WB].adf / TUTORIALS / Recover_Files < prev    next >
Text File  |  1988-05-28  |  10KB  |  192 lines

  1.  
  2. RETRIEVING ACCIDENTALLY DELETED FILES - OR WHAT TO DO WHEN YOUR FAVOURITE
  3.  
  4.                         PROGRAMME DISAPPEARS.
  5.                         ---------------------
  6.                                              by Keith Simpson
  7.  
  8.     [Ed: This is a very useful article for anyone who's ever lost a file
  9.      (everyone?), and is a good introduction to getting deeper into the
  10.      DOS file structure. The techniques here can be used by single-drive
  11.      users with the help of the RAM disk as described. Anyone interested
  12.      in looking further could have a look at Steve Wright's fine article
  13.      "DiskStructure" on Megadisc3.]
  14.  
  15. It has probably happened to all of us at one time or another, you are in
  16. the CLI and decide to delete a couple of files named TEST1 & TEST2 so you
  17. type   DELETE TES#?  and what happens, TEST1, TEST2 and TESTDRIVE all
  18. disappear. Easy to get rid of but how do you get TESTDRIVE back?
  19.  
  20. Well what you have to do to recover your file or even a whole directory
  21. will depend on what you lost and how you lost it. What you will
  22. need are a few utilities as follow - DISKDOCTOR presently in the 'C'
  23. directory of your WORKBENCH disk may be a help, but I would strongly
  24. recommend you write to MegaDisc and order Fish 108 for a utility called
  25. SECTORAMA and also a copy of Amigan 16 which contains a utility called
  26. UNDELETE.
  27.  
  28. As there are several ways you can lose files, I will deal with these
  29. separately with the possible cures as follows:-
  30.  
  31. NOTE HOWEVER THAT IF USING DISKDOCTOR YOU SHOULD MAKE A COPY OF YOUR
  32. ORIGINAL DISK USING A COMMERCIAL DISK COPY PROGRAMME SUCH AS MARAUDER
  33. WHICH COPIES THE DISK EXACTLY AND WORK ON THAT COPY - YOU DON'T WANT TO
  34. TRASH THE WHOLE DISK DO YOU!! - FURTHERMORE, NOTHING IS LIKELY TO WORK
  35. IF YOU HAVE WRITTEN SOMETHING TO THE DISK FOLLOWING THE ACCIDENTAL
  36. ERASURE OF A FILE.
  37.  
  38. 1. You have been using WORKBENCH and have decided you no longer need
  39. a certain file, so you drag the Icon over to the Trashcan and put it in
  40. the trash. You then decide you really needed the file - no problem, just
  41. click on the Trashcan Icon and there is your deleted file - the Trashcan
  42. is really just another directory to which you transfer files on their
  43. way to being deleted, they are not actually deleted until you perform
  44. the Empty Trashcan function from the WORKBENCH menu.
  45.  
  46. 2. Another possible cause of lost files is when you drag an icon around on
  47. workbench to clean it up, and accidentally click the mouse when it is over
  48. another drawer icon, this causes the original icon file to disappear,
  49. but your file has only been transferred into the drawer, and
  50. doubleclicking on the drawer will resurrect your file.
  51.  
  52. 3. Finally the most dangerous trap of all on the WORKBENCH is when using
  53. Extended Selection of Icons to say move 2 icons at once, you hold down
  54. the shift key and click on each Icon in turn. Unfortunately what the
  55. manual does not tell you is that if your mouse slips and you
  56. accidentally double-click on the button, your disk drive will run,
  57. and your Icons will disappear. Under some circumstances
  58. double clicking on an icon while the shift key is depressed causes
  59. the file or directory associated with the Icon to be deleted.
  60. On other occasions you may find your missing files have been
  61. erroneously transferred to the wrong directory. (It is always worth
  62. looking in all the drawers if something goes astray).
  63.  
  64. To recover from this problem, see items 4 - 6 below.
  65.  
  66. 4. TO RECOVER A SINGLE FILE CALLED "TESTDRIVE"
  67. Where a single file has been accidentally deleted, the easiest way to
  68. recover it is using "UNDELETE" on Amigan 16. This file should be copied
  69. into your "C" directory, or directly into RAM: which is the method I will
  70. demonstrate, assuming that only a single disk-drive is available.
  71. From the CLI with undelete in RAM: type
  72.                UNDELETE TESTDRIVE RAM:  (where RAM: is the device
  73.                                         the file will be written to).
  74. You will receive a message telling you to put the disk in DF0:
  75. then press RETURN. UNDELETE will read the whole disk for a file
  76. called "TESTDRIVE" and if found will write it to RAM: with the block
  77. number appended. i.e. if found at block 950 it would be saved as
  78. RAM:TESTDRIVE.950. This is a safeguard if two files of the same
  79. name are on your disk.
  80. You can then save your found file back to the disk using the CLI
  81. statements:
  82.        RENAME RAM:TESTDRIVE.950 AS RAM:TESTDRIVE
  83.        COPY RAM:TESTDRIVE TO DF0:
  84.  
  85. Where a whole directory has been deleted, the same procedure can be used
  86. for each file in the directory - but this assumes you can remember the
  87. names of all the files which is unlikely. If you know all the filenames
  88. in your deleted directory, then proceed as follows:
  89. From the CLI assuming the deleted directory was called "TESTFILES" issue
  90. the command
  91.                        MAKEDIR RAM:TESTFILES
  92. then proceed as above for single files except that the command for
  93. UNDELETE should be "UNDELETE TESTDRIVE RAM:TESTFILES/" which will cause
  94. the found files to be deposited in the RAM:TESTFILES directory - Once all
  95. the files have been found, you must rename them all as above then issue
  96. the following CLI commands:-
  97.  MAKEDIR DF0:TESTFILES
  98.  COPY RAM:TESTFILES TO DF0:TESTFILES ALL
  99.  
  100. 5. If you do not remember the filenames in the deleted directory, then
  101. there are 2 courses open to you. First you can try DISKDOCTOR as in
  102. this paragraph or alternatively SECTORAMA as in paragraph 6.
  103. Personally I am very wary about using DISKDOCTOR as on a couple of
  104. occasions this programme has left me with completely useless disks,
  105. nevertheless on some occasions it will work and the procedure is as
  106. follows assuming you are using DF0: for your corrupt disk.
  107. Enter the CLI command
  108.           DISKDOCTOR DF0:
  109. DISKDOCTOR will then read through your disk, and will usually find
  110. all files which have been deleted and are not overwritten and will list
  111. them in the Root Directory for you, it will also report on files it finds
  112. which have garbled data in them and will replace certain files.
  113. Here you may come up with a problem as I have found DISKDOCTOR has
  114. a habit of replacing good files with bad ones, and the last time I
  115. used it, I ended up with two "DEVS" directories, both different on
  116. the disk and with the DISK-VALIDATOR corrupt.
  117.  
  118. However if you are working on a copy disk as I stated at the beginning
  119. and your missing files appear, you can now copy them to your original
  120. disk, and remember to FORMAT your copy disk before using it again.
  121.  
  122. 6. USING SECTORAMA
  123. The version of this programme on Fish 108 is version 1.1, it is not yet
  124. finished and comes with somewhat scant documentation, however on a couple
  125. of occasions it has proved invaluable in retrieving files which I thought
  126. had been lost for ever.
  127.  
  128. Assume once more that the Directory "TESTFILES" has been accidentally
  129. deleted, it contained 6 files and you remember one was called "TESTDRIVE"
  130. then proceed as follows:
  131. a) Enter CLI command        MAKEDIR RAM:TESTFILES
  132. b) Run SECTORAMA DF0: - you will get a darkblue interlaced screen with light
  133. blue writing. The display will be of the Root Block of the disk in DF0:
  134. in this case the disk that had SECTORAMA on it.
  135. c) Put your corrupt disk in DF0: and type "R", and the display will be
  136. of the Root Block of your disk.
  137. d) Press the menu select button of your mouse, and go to the Sector Search
  138. menu and select item 1) Filename. You will get a requester in which you
  139. should enter TESTDRIVE and click on the OK button.
  140. e) SECTORAMA will then search the disk for the filename TESTDRIVE and if
  141. found you will have a "Longword" printed out at the top of the display
  142. e.g. 00000309 which is the block at which TESTDRIVE has been found.
  143. f) Move mousepointer to this longword and press the select button to
  144. highlight it, then type "J" to Jump to the block.
  145. g) You will now get a display of the first block of TESTDRIVE - You know
  146. that this file belonged to the directory TESTFILES, therefore pressing
  147. "P" will return you to the parent directory. If the directory has
  148. been deleted you will get a corrupt display, at the top of which
  149. will appear in place of the description "Directory" the word
  150. "Corrupt". Fortunately, SECTORAMA can cope with this, as you can
  151. now select the SECTOR SEARCH menu again, and select item 2) Parent
  152. Block, SECTORAMA will now search for all files which have the same
  153. "Parent", and give you a new list of "Longwords", and as there were
  154. 6 files in TESTFILES, you should now get a list of 6 Longwords
  155. representing the first block of each of the six files.
  156. h) Select the first Longword with the mouse, and type J to jump to it,
  157. you will get a display of the first file, the filename will appear 5
  158. lines from the bottom of the second section of the display, e.g.
  159. TESTONE, select the save file menu, and for Open File Name type
  160.               RAM:TESTFILES/TESTONE.
  161. Then go to the 2nd menu and select the "Write All" function, which
  162. writes the block and all subsequent blocks of the file into RAM:
  163. This can take quite a long time if the file is very long.
  164. i) Select the first menu again and close the file.
  165. j) Now type "L" to redisplay the "Last" sector search result - i.e.
  166. the display of the 6 Longwords in item "g" above. Now select the
  167. second longword and continue as in h) and i) above until all six
  168. files have been saved into RAM:.
  169. k) Finally you can now restore all the files to your disk with the
  170. commands:-
  171.   MAKEDIR DF0:TESTFILES
  172.   COPY RAM:TESTFILES TO DF0:TESTFILES ALL
  173.  
  174. I know all this seems like a lot of work, however it is a lot easier
  175. than rewriting or repurchasing valuable programmes. There may be
  176. better ways to do it, and there are other DISKDOCTOR type programmes
  177. around, but most of these require two drives and I have set out
  178. to describe how you can do this on a single drive machine which is
  179. the equipment most of us will have. (And by the time you have
  180. got two drives, you should know how to resurrect files anyway!!).
  181.  
  182. NOTE: As an alternative in item g) above, instead of instituting
  183. a search for files with the same "Parent Key", you can select the
  184. 3rd menu and pick the "Verify Directory" item, this will give you
  185. a list of all filenames in the deleted directory, and you can use
  186. UNDELETE to regain them - If one method does not work, then the
  187. other should.
  188.  
  189.  
  190. XXXXXXXXXXXXXXXXXXXXXXXXXXX END OF RECOVER_FILES XXXXXXXXXXXXXXXXXXXXXXX
  191.  
  192.